package com.sun.androidexerciseproject.function.model;

import android.support.annotation.NonNull;

/**
 * Created by Administrator on 2017/6/24.
 */

public class PayModel implements Comparable<PayModel> {
    int mType;
    String mTypeName;

    public PayModel(int type, String typeName) {
        mType = type;
        mTypeName = typeName;
    }

    public int getType() {
        return mType;
    }

    public void setType(int type) {
        mType = type;
    }

    public String getTypeName() {
        return mTypeName;
    }

    public void setTypeName(String typeName) {
        mTypeName = typeName;
    }

    @Override
    public int compareTo(@NonNull PayModel o) {
        return -(this.mType - o.mType);
    }

    @Override
    public String toString() {
        return "{mType = " + mType + " mTypeName = " + mTypeName + "}";
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof PayModel) {
            PayModel model = (PayModel) obj;
            if (mType == model.mType) {
                return true;
            }
        }
        return false;
    }
}
